package com.linked.mystyle.statement.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.linked.mystyle.statement.bean.param.StatementPageParam;
import com.linked.mystyle.statement.bean.po.StatementInfoPO;
import com.linked.mystyle.statement.mapper.IStatementMapper;
import com.linked.mystyle.statement.service.IStatementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author :dbq
 * @date : 2022/10/17 15:34
 */
@Service
public class StatementServiceImpl implements IStatementService {

    private final IStatementMapper statementMapper;

    @Autowired
    public StatementServiceImpl(IStatementMapper statementMapper) {
        this.statementMapper = statementMapper;
    }

    @Override
    public Boolean saveStatement(StatementInfoPO param) throws Exception {
        return statementMapper.insert(param) > 0;
    }

    @Override
    public IPage<StatementInfoPO> queryStatementPage(StatementPageParam param) throws Exception {
        return statementMapper.queryStatementPage(param);
    }

    @Override
    public Boolean updateStatement(StatementInfoPO param) throws Exception {
        return statementMapper.updateById(param) > 0;
    }
}
